{% extends 'base_foot.html' %}

{%block head%}
	<script type="text/javascript" src='/static/js/jquery-1.12.4.min.js'></script>
	<script>
		$(function(){
			$.get('/cart/cart_goods_type_count/', function(data){
				$('#show_count').text(data.goods_count);
			});
		});
	</script>
	{%block index_head%}{%endblock index_head%}
{%endblock head%}

{%block body%}
<body>
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到天天生鲜!</div>
			<div class="fr">
				<!-- 登陆之后显示用户名 -->
				{% if request.session.user_name|default:'' != '' %}
					<div class="login_btn fl">					
						欢迎您：<em style="color:#ff8800">{{request.session.user_name}}</em>
						<span>|</span>
						<a href="/user/logout/">登出</a>
					</div>
				{% else %}
					<div class="login_btn fl">
						<a href="/user/login/">登录</a>
						<span>|</span>
						<a href="/user/register/">注册</a>
					</div>					
				{% endif %}

				<div class="user_link fl">
					<span>|</span>
					<a href="/user/user_info">用户中心</a>
					<span>|</span>
					<a href="/cart/">我的购物车</a>
					<span>|</span>
					<a href="/user/user_order_1/">我的订单</a>
				</div>
			</div>
		</div>		
	</div>

	<div class="search_bar clearfix">
		<a href="/" class="logo fl"><img src="/static/images/logo.png"></a>
		<div class="search_con fl">
			<input type="text" class="input_text fl" name="" placeholder="搜索商品">
			<input type="button" class="input_btn fr" name="" value="搜索">
		</div>
		<div class="guest_cart fr">
			<a href="/cart/" class="cart_name fl">我的购物车</a>
			<div class="goods_count fl" id="show_count">0</div>
		</div>
	</div>

	{%block goods_body%}{%endblock goods_body%}
{%endblock body%}

{%block foot%}{%block goods_foot%}{%endblock goods_foot%}{%endblock foot%}


